Skip to content

Add support for class constants types - #32

Merged
thekid merged 5 commits into
mainfrom
feature/typed_class_constants
Apr 17, 2023
Merged

Add support for class constants types#32
thekid merged 5 commits into
mainfrom
feature/typed_class_constants

Conversation

@thekid

@thekid thekid commented Apr 10, 2023

Copy link
Copy Markdown
Member

See https://wiki.php.net/rfc/typed_class_constants, targeted for PHP 8.3:

class Tests {
  const string PREFIX= "Test";
}

$c= Reflection::type(Tests::class)->constant('PREFIX')->constraint();
$c->present(); // true
$c->type();    // Primitive::$STRING

Also supports @var and @type apidocs, see https://stackoverflow.com/questions/3892063/phpdoc-class-constants-documentation

Comment thread src/main/php/lang/reflection/Constant.class.php Outdated
@thekid thekid added the enhancement New feature or request label Apr 10, 2023
@thekid
thekid merged commit 6b79239 into main Apr 17, 2023
@thekid
thekid deleted the feature/typed_class_constants branch April 17, 2023 18:38
@thekid

thekid commented Apr 17, 2023

Copy link
Copy Markdown
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant